<?php 
class AppController extends Controller
{
    var $helpers = array(
        'Html', 'Form', 'Ajax', 'Javascript'
    );
    
    function __mainValidate($action, $redirection = array(
        'controller'=>HOME_CONTROLLER, 'action'=>'index'
    ))
    {
        $access = $this->Session->read('accessArray');
        if (!$access[$action])
		{
			$this->Session->setFlash(__('You don\'t have access to this page.<br/>', true));
            $this->redirect($redirection);
		}
    }
}
?>
